﻿// See https://aka.ms/new-console-template for more information
using Emit.Test;
using Infrastructure.DynamicProxy;
using Microsoft.Extensions.DependencyInjection;
using Orc.Generics;

Console.WriteLine("Hello, World!");

//Emit编写测试
//Emit.Test.TInterface i = MyDynamicProxy.CreateIntercepted<Emit.Test.TInterface>();
//i.Name();


IServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddTransient(typeof(AOPTest));
serviceCollection.AddTransient<ITestService, TestService>();
ServiceHelp.BuildServiceProvider(serviceCollection);
//用工厂获取代理实例
var s = ProxyFactory.Create<ITestService>();
var sum = s.Add(1, 2);
Console.WriteLine("执行完毕=====>" + sum);


